package com.cn.zy.protocol.entity;

/**
 * @author zhangyi
 * @date 2019/2/25 16:05
 */
public class Person {
    private int id;
    private int age;
    private String name;
    private boolean isSex;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isSex() {
        return isSex;
    }

    public void setSex(boolean sex) {
        isSex = sex;
    }

    public Person(int id, int age, String name, boolean isSex) {
        this.id = id;
        this.age = age;
        this.name = name;
        this.isSex = isSex;
    }

    @Override
    public String toString() {
        final StringBuilder sb = new StringBuilder("{");
        sb.append("\"id\":")
                .append(id);
        sb.append(",\"age\":")
                .append(age);
        sb.append(",\"name\":\"")
                .append(name).append('\"');
        sb.append(",\"isSex\":")
                .append(isSex);
        sb.append('}');
        return sb.toString();
    }
}
